﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using WyUnity.Data.Query;
using WyUnity.Data.TableMapper;

namespace RFID_Interface.DTO
{

    public class User : ViewBase<User>
    {
        [Map("FUserID")]
        public int UserID { get; set; }
        [Map("FName")]
        public string Name { get; set; }


        public static FieldBase pUserID = new Field<User>(p => p.UserID);
        public static FieldBase pName = new Field<User>(p => p.Name);
        public override string GetSQLClip()
        {
            return @"SELECT  FUserID , FName
FROM    t_User AS ts
WHERE   FUserID>10000 and FForbidden=0";
        }
        public static List<User> GetAll()
        {
            using (var db = DB.Open())
            {
                return db.QueryList<User>(null, pUserID.Arc);
            }
        }
    }
}